package basic.io;

import java.io.File;

public class FileDeleteDemo {
	
	public static void main(String[] args) {
        
		File  srcFilder = new File("demo");
		deleteFile(srcFilder);
		
	}
	public static void deleteFile(File file){
		File[] fileArray = file.listFiles();
		for(File file2 :fileArray){
			if(file2.isDirectory()){
				deleteFile(file2);
			}
			else{
				System.out.println(file2.getName()+file2.delete());
			}
			
		}
		System.out.println(file.getName()+file.delete());
	}

}
